<?php
namespace app\index\validate;
use think\Validate;
use think\Db;
class Face extends Validate{
    protected $rule = [
    	'idcard'		=> ['require','checkIdcard'],
    	'phone'			=> ['require','checkphone'],
    ];
	protected $message=[
		'idcard.require'	=>'身份证号不能为空',
		'idcard.checkIdcard'=>'该身份证无效',
		'phone.require'	    => '手机号码不能为空',
		'phone.checkphone'  => '手机号码格式错误',
	];
	protected $scene=[
		'check_user'=>[
			'phone',
			'idcard'=>'require|checkIdcard',
		]
	];
	protected function checkIdcard($val){
		return isIdCard($val);
	}
	//验证手机号
	protected function checkphone($val){
		return check_mobile($val);
	}
}
